﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using hospital_registration_system.BLL;
using hospital_registration_system.Entity;

namespace hospital_registration_system.Utility
{
    /// <summary>
    /// 用户查询就诊记录
    /// </summary>
    public class UserMedicalRecord
    {
        protected static Medical_recordService service = new Medical_recordService();

        /// <summary>
        /// 查看指定患者的所有的就诊记录
        /// </summary>
        /// <param name="patient_id">患者id</param>
        /// <returns>查询到的记录</returns>
        public static List<Medical_record> selectAllRecord(int patient_id)
        {
            return service.selectMedicalRecordByPId(patient_id);
        }

        /// <summary>
        /// 根据id删除记录
        /// </summary>
        /// <param name="id">要删除的患者id</param>
        /// <returns></returns>
        public static string deleteRecord(int id)
        {
            if (service.deleteMedical_record(id))
            {
                return "成功";
            }
            else
            {
                return "失败";
            }
        }
    }
}
